﻿@using Shop.Entity
@using Shop.Tools
@{
    var userInfo = Context.Session.Get<ComUser>(SessionKeys.UserInfo);
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"]</title>

    <environment include="Development">
        <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
    </environment>
    <environment exclude="Development">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css" asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" crossorigin="anonymous" integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
    </environment>
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="/lib/element-ui/theme-chalk/index.css" />
</head>
<body>
    <a name="topBar" style="position: absolute; top: -155px; left: -99px;"></a>
<header class="master-header">
    <nav class="navbar navbar-expand-sm  navbar-light bg-white border-bottom mb-3">
        <div class="container">
            <a class="navbar-brand font-weight-bold" asp-area="" asp-controller="Home" asp-action="Index">电子商城</a>
            <div class="collapse navbar-collapse">
                @if (userInfo != null && !userInfo.UserName.IsNullOrEmpty())
                {
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item dropdown">
                            <a class="navbar-brand  dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">@userInfo.UserName</a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                                <a class="dropdown-item" asp-area="" asp-controller="Member" asp-action="Index">个人中心</a>
                                <a class="dropdown-item" asp-area="" asp-controller="Login" asp-action="Logout">退出</a>
                            </div>
                        </li>
                        <li class="nav-item" id="lishowSearch" style="display: none;">
                            @using (Html.BeginForm("Login", "Login", new {ReturnUrl = ViewData["ReturnUrl"]}, FormMethod.Post, true, new {id = "fnBarLogin"}))
                            {
                                @Html.AntiForgeryToken()
                                <div class="form-group row no-margin border-radius-20">
                                    <div class="col-lg-9 padding-right-none">
                                        <input type="text" class="form-control border-none no-focus" id="keywords" placeholder="商品">
                                    </div>
                                    <div class="col-lg-3 btn-search">
                                        <button class="form-control hand border-none">搜索</button>
                                    </div>
                                </div>
                            }
                        </li>
                    </ul>
                    <a class="navbar-brand" asp-area="" asp-controller="ShopCar" asp-action="Index">购物车</a>
                    <a class="navbar-brand" asp-area="" asp-controller="OrderMgt" asp-action="Index">订单管理</a>
                    <a class="navbar-brand" asp-area="" asp-controller="BillingMgt" asp-action="Index">开票管理</a>
                    if (!userInfo.IsNormal)
                    {
                        <a class="navbar-brand" href="/Admin/Default">后台管理</a>
                    }
                }
                else
                {
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item">
                            <a class="navbar-brand color-red" asp-area="" asp-controller="Login" asp-action="Index">亲，请登录</a>
                        </li>
                        <li class="nav-item" id="lishowSearch" style="display: none;">
                            @using (Html.BeginForm("Login", "Login", new {ReturnUrl = ViewData["ReturnUrl"]}, FormMethod.Post, true, new {id = "fnBarLogin"}))
                            {
                                @Html.AntiForgeryToken()
                                <div class="form-group row no-margin border-radius-20">
                                    <div class="col-lg-9 padding-right-none">
                                        <input type="text" class="form-control  border-none no-focus" id="keywords" placeholder="商品">
                                    </div>
                                    <div class="col-lg-3 btn-search">
                                        <button class="form-control hand border-none">搜索</button>
                                    </div>
                                </div>
                            }
                        </li>
                    </ul>

                    <a class="navbar-brand" asp-area="" asp-controller="Login" asp-action="Index">购物车</a>
                    <a class="navbar-brand" asp-area="" asp-controller="Login" asp-action="Index">订单管理</a>
                    <a class="navbar-brand" asp-area="" asp-controller="Login" asp-action="Index">开票管理</a>
                }
            </div>
        </div>
    </nav>
</header>

<div class="container-search">
    @using (Html.BeginForm("Login", "Login", new {ReturnUrl = ViewData["ReturnUrl"]}, FormMethod.Post, true, new {id = "fnLogin"}))
    {
        @Html.AntiForgeryToken()
        <div class="form-group row">
            <div class="col-sm-2 text-center padding-right-none">
                <img src="/image/dsicon.png" height="60" width="60"/>
            </div>
            <div class="col-sm-7  padding-none">
                <input type="text" class="form-control search-control border-radius-13" id="keywords" placeholder="商品">
            </div>
            <div class="col-sm-3">
                <button class="form-control col-5 search-control hand">搜索</button>
            </div>
        </div>
    }
</div>
<div class="container-content">

    @RenderBody()
</div>
<div id="returnTop" class="hand" style="display: none;"><a onclick="window.location.href='#topBar'">TOP</a></div>
<footer class="border-top footer text-muted">
    <div class="container">
        &copy; 2019 - ShopWeb - <a asp-area="" asp-controller="Home" asp-action="Privacy">个人隐私</a>
    </div>
</footer>

<environment include="Development">
    <script src="~/lib/jquery/dist/jquery.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
</environment>
<environment exclude="Development">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" asp-fallback-src="~/lib/jquery/dist/jquery.min.js" asp-fallback-test="window.jQuery" crossorigin="anonymous" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js" asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js" asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal" crossorigin="anonymous" integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4="></script>
</environment>
<script src="/lib/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/lib/bootstrap-autohidingnavbar/jquery.bootstrap-autohidingnavbar.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
<script src="/lib/arrayExtend/arrayExtend.min.js"></script>
@RenderSection("Scripts", required: false)
</body>
</html>
